import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import Element from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import axios from './axios'
import {setCookie, getCookie, delCookie} from './assets/js/cookie.js'
import svgIcon from 'vue-svg-icon/Icon.vue'
import {initWebsocket,wsSend,wsOnClose} from './webSocket'


Vue.prototype.$axios = axios //全局引用
Vue.config.productionTip = false
Vue.use(Element)
Vue.prototype.$cookieStore = {setCookie, getCookie, delCookie}
Vue.prototype.$wsServer = {initWebsocket,wsSend,wsOnClose};

//Vue.prototype.$media = webSocketMedia
// //设置请求头
// axios.defaults.baseURL = "http://localhost:8088/"
// axios.interceptors.request.use(config => {
//   console.log(config);
//   // 请求头挂载信息
//   config.headers.Authorization = window.sessionStorage.getItem("flag");
//   // 在最后必须return config
//   return config;
// })
Vue.component('svgIcon', svgIcon)


new Vue({
  router,

  store,
  render: h => h(App)
}).$mount('#app')
